﻿<%@ Control Language="VB" AutoEventWireup="false" CodeFile="Create.ascx.vb" Inherits="Control_VBPQ_Create" %>
<%@ Register TagPrefix="CE" Namespace="CuteEditor" Assembly="CuteEditor" %>
<script type="text/javascript">
    function ajaxJquery() {
        $(function () {
            //Upload Image
            $('#file_upload').uploadify({
                'uploader': '<%=ResolveUrl("~/uploadify/uploadify.swf")%>',
                'script': '<%=ResolveUrl("~/uploadify/Upload.ashx?folder=ImageStorage")%>',
                'cancelImg': '<%=ResolveUrl("~/uploadify/cancel.png")%>',
                'folder': '<%=ResolveUrl("~/Uploads")%>',
                'auto': false,
                'multi': false,
                'fileExt': '*.*',
                'fileDesc': 'Files',
                'fileDataName': 'myfile',
                'sizeLimit': '<%= ConfigurationManager.AppSettings("maxupload") %>',
                'onComplete': function (event, ID, fileObj, response, data) {
                    $('#<%=hidImagePath.ClientID %>').val('<%= ConfigurationManager.AppSettings("ImageDomain") %>' + response);

                }
            });
            // register thickbox after postback
            var isAsyncPostback = Sys.WebForms.PageRequestManager.getInstance().get_isInAsyncPostBack();
            if (isAsyncPostback) {
                tb_init('a.thickbox, area.thickbox, input.thickbox');
            }

            $("#<%=txtPublisheddate.ClientID %>").datepicker({ dateFormat: 'dd/mm/yy' });
            $("#<%=txtPrintedDate.ClientID %>").datepicker({ dateFormat: 'dd/mm/yy' });
            $("#<%=txtValidatedDate.ClientID %>").datepicker({ dateFormat: 'dd/mm/yy' });
            $("#<%=txtExpiredDate.ClientID %>").datepicker({ dateFormat: 'dd/mm/yy' });
        });
    }

    function setVBPQValue() {
        $("#<%=btnReloadList.ClientId %>").click();
    }
    //    function getPromulgatorValue() {
    //        return $("#<%=txtPromulgator.ClientID()%>").val();
    //    }
</script>
<asp:UpdatePanel runat="server" ID="uplVBPQDocument">
    <ContentTemplate>
        <div class="content_porletform">
            <div class="HeadTitle">
                <h3>
                    BIÊN TẬP VĂN BẢN PHÁP QUY</h3>
            </div>
            <div class="box_contentform">
                <div class="box_scroll_grid">
                    <div class="DivRequired">
                        <span class="fieldRequired">&nbsp;</span>Trường yêu cầu nhập dữ liệu
                    </div>
                    <div class="Error">
                        <asp:ValidationSummary ID="ValidationSummary1" runat="server" ForeColor="#FF3300" />
                    </div>
                    <div class="DivRow">
                        <div class="DivLabel">
                            <asp:Label ID="lblTrichYeu" CssClass="TextLabel" runat="server" Text="Trích yếu:" />
                            <span class="fieldRequired">&nbsp;<asp:RequiredFieldValidator ID="RequiredFieldValidator1"
                                runat="server" ControlToValidate="txtTitle" Display="None" ErrorMessage="Trích yếu không được để trống."></asp:RequiredFieldValidator>
                            </span>
                        </div>
                        <div class="DivTextBox">
                            <asp:TextBox ID="txtTitle" CssClass="TextBox" runat="server" Text="" Height="71px"
                                TextMode="MultiLine" />
                        </div>
                    </div>
                    <div class="DivRow">
                        &nbsp;</div>
                    <div class="DivRow">
                        <div class="DivLabel">
                            <asp:Label ID="Label4" CssClass="TextLabel" runat="server" Text="Số hiệu văn bản:" />
                            <span class="fieldRequired">&nbsp;<asp:RequiredFieldValidator ID="RequiredFieldValidator6"
                                runat="server" ControlToValidate="txtCode" Display="None" ErrorMessage="Số hiệu văn bản không được để trống."></asp:RequiredFieldValidator>
                            </span>
                        </div>
                        <div class="DivTextBox">
                            <asp:TextBox ID="txtCode" CssClass="TextBox" runat="server" Text="" />
                        </div>
                    </div>
                    <div class="DivRow">
                        <div class="DivLabel">
                            <asp:Label ID="Label7" CssClass="TextLabel" runat="server" Text="Loại văn bản:" />
                            <span class="fieldRequired">&nbsp;<asp:RequiredFieldValidator ID="RequiredFieldValidator7"
                                runat="server" ControlToValidate="drpType" Display="None" ErrorMessage="Loại văn bản không được để trống."></asp:RequiredFieldValidator>
                            </span>
                        </div>
                        <div>
                            <asp:DropDownList runat="server" ID="drpType" CssClass="DropdownList">
                            </asp:DropDownList>
                            <asp:HyperLink ID="hplTypeInsert" runat="server" CausesValidation="false" Text="Thêm"></asp:HyperLink>
                        </div>
                    </div>
                    <%--<div class="DivRow">
        <div class="DivLabel">
            <asp:Label ID="Label1" CssClass="TextLabel" runat="server" Text="Trạng thái:" />
            <span class="fieldRequired">&nbsp;<asp:RequiredFieldValidator ID="RequiredFieldValidator2"
                runat="server" ControlToValidate="drpStatus" Display="None" ErrorMessage="Trạng thái không được để trống."></asp:RequiredFieldValidator>
            </span>
        </div>
        <div>
            <asp:DropDownList runat="server" ID="drpStatus" Width="40%">
            </asp:DropDownList>           
        </div>
    </div>--%>
                    <div class="DivRow">
                        <div class="DivLabel">
                            <asp:Label ID="lblNgayBanHanh" CssClass="TextLabel" runat="server" Text="Ngày ban hành:" /><span
                                class="fieldRequired">&nbsp;</span>
                        </div>
                        <div class="DivTextBox">
                            <asp:TextBox ID="txtPublishedDate" CssClass="TextBox" runat="server" Text="" />(dd/mm/yyyyy)
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator8" runat="server" ControlToValidate="txtPublishedDate"
                                Display="None" ErrorMessage="Vui lòng nhập ngày ban hành."></asp:RequiredFieldValidator>
                            <asp:RegularExpressionValidator ID="RegularExpressionValidator3" runat="server" ControlToValidate="txtPublishedDate"
                                Display="None" ErrorMessage="Ngày ban hành không đúng định dạng" ValidationExpression="^(((0[1-9]|[12]\d|3[01])\/(0[13578]|1[02])\/((19|[2-9]\d)\d{2}))|((0[1-9]|[12]\d|30)\/(0[13456789]|1[012])\/((19|[2-9]\d)\d{2}))|((0[1-9]|1\d|2[0-8])\/02\/((19|[2-9]\d)\d{2}))|(29\/02\/((1[6-9]|[2-9]\d)(0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])00))))$"></asp:RegularExpressionValidator>
                        </div>
                    </div>
                    <div class="DivRow">
                        <div class="DivLabel">
                            <asp:Label ID="Label8" CssClass="TextLabel" runat="server" Text="Ngày đăng công báo:" />
                        </div>
                        <div class="DivTextBox">
                            <asp:TextBox ID="txtPrintedDate" CssClass="TextBox" runat="server" Text="" />(dd/mm/yyyyy)
                            <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="txtPrintedDate"
                                Display="None" ErrorMessage="Ngày đăng công báo không đúng định dạng" ValidationExpression="^(((0[1-9]|[12]\d|3[01])\/(0[13578]|1[02])\/((19|[2-9]\d)\d{2}))|((0[1-9]|[12]\d|30)\/(0[13456789]|1[012])\/((19|[2-9]\d)\d{2}))|((0[1-9]|1\d|2[0-8])\/02\/((19|[2-9]\d)\d{2}))|(29\/02\/((1[6-9]|[2-9]\d)(0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])00))))$"></asp:RegularExpressionValidator>
                        </div>
                    </div>
                    <div class="DivRow">
                        <div class="DivLabel">
                            <asp:Label ID="Label9" CssClass="TextLabel" runat="server" Text="Ngày có hiệu lực:" />
                        </div>
                        <div class="DivTextBox">
                            <asp:TextBox ID="txtValidatedDate" CssClass="TextBox" runat="server" Text="" />(dd/mm/yyyyy)
                            <asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" ControlToValidate="txtValidatedDate"
                                Display="None" ErrorMessage="Ngày có hiệu lực không đúng định dạng" ValidationExpression="^(((0[1-9]|[12]\d|3[01])\/(0[13578]|1[02])\/((19|[2-9]\d)\d{2}))|((0[1-9]|[12]\d|30)\/(0[13456789]|1[012])\/((19|[2-9]\d)\d{2}))|((0[1-9]|1\d|2[0-8])\/02\/((19|[2-9]\d)\d{2}))|(29\/02\/((1[6-9]|[2-9]\d)(0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])00))))$"></asp:RegularExpressionValidator>
                        </div>
                    </div>
                    <div class="DivRow">
                        <div class="DivLabel">
                            <asp:Label ID="Label10" CssClass="TextLabel" runat="server" Text="Ngày hết hiệu lực:" />
                        </div>
                        <div class="DivTextBox">
                            <asp:TextBox ID="txtExpiredDate" CssClass="TextBox" runat="server" Text="" />(dd/mm/yyyyy)
                            <asp:RegularExpressionValidator ID="RegularExpressionValidator4" runat="server" ControlToValidate="txtExpiredDate"
                                Display="None" ErrorMessage="Ngày hết hiệu lực không đúng định dạng" ValidationExpression="^(((0[1-9]|[12]\d|3[01])\/(0[13578]|1[02])\/((19|[2-9]\d)\d{2}))|((0[1-9]|[12]\d|30)\/(0[13456789]|1[012])\/((19|[2-9]\d)\d{2}))|((0[1-9]|1\d|2[0-8])\/02\/((19|[2-9]\d)\d{2}))|(29\/02\/((1[6-9]|[2-9]\d)(0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])00))))$"></asp:RegularExpressionValidator>
                        </div>
                    </div>
                    <div class="DivRow">
                        <div class="DivLabel">
                            <asp:Label ID="Label11" CssClass="TextLabel" runat="server" Text="Nguồn trích:" />
                        </div>
                        <div class="DivTextBox">
                            <asp:TextBox ID="txtPublisher" CssClass="TextBox" runat="server" Text="" />
                        </div>
                    </div>
                    <div class="DivRow">
                        <div class="DivLabel">
                            <asp:Label ID="label12" CssClass="TextLabel" runat="server" Text="Cơ quan ban hành:" />
                        </div>
                        <div class="DivTextBox">
                            <asp:ListBox ID="lsbExistingPromulgator" runat="server" Width="13em" Style="float: left"
                                size="4" SelectionMode="Multiple"></asp:ListBox>
                            <div class="" style="float: left; width: 48px; height: 69px; padding-left: 19px;">
                                <asp:Button Text=">>>" ID="btnMoveCQBH" runat="server" CausesValidation="false" Style="margin-bottom: 5px;" /><br />
                                <asp:Button ID="btnMoveBackCQBH" runat="server" Text="<<<" CausesValidation="false"
                                    Style="margin-bottom: 5px;" /><br />
                                <asp:HyperLink ID="hplInsertCQBH" runat="server" CausesValidation="false" Text="Thêm"></asp:HyperLink>
                            </div>
                            <asp:ListBox ID="lsbPromulgator" runat="server" SelectionMode="Multiple" Width="13em"
                                size="4"></asp:ListBox>
                        </div>
                    </div>
                    <div class="DivRow">
                        &nbsp;</div>
                    <div class="DivRow">
                        <div class="DivLabel">
                            <asp:Label ID="label13" CssClass="TextLabel" runat="server" Text="Người ký:" />
                        </div>
                        <div class="DivTextBox">
                            <asp:ListBox ID="lsbExistingSigner" runat="server" Style="float: left" SelectionMode="Multiple"
                                Width="13em" size="8"></asp:ListBox>
                            <div class="" style="float: left; width: 48px; height: 69px; padding-left: 19px;">
                                <asp:Button ID="btnMoveSigner" runat="server" Text=">>>" CausesValidation="false"
                                    Style="margin-bottom: 5px;" /><br />
                                <asp:Button ID="btnMoveBackSigner" runat="server" Text="<<<" CausesValidation="false"
                                    Style="margin-bottom: 5px;" /><br />
                                <asp:HyperLink ID="hplInsertSigner" runat="server" CausesValidation="false" Text="Thêm"></asp:HyperLink>
                            </div>
                            <asp:ListBox ID="lsbSigner" runat="server" Style="float: left" SelectionMode="Multiple"
                                Width="13em" size="8"></asp:ListBox>
                        </div>
                    </div>
                    <div class="DivRow">
                        &nbsp;</div>
                    <div class="DivRow">
                        <div class="DivLabel">
                            <asp:Label ID="label14" CssClass="TextLabel" runat="server" Text="Chức danh:" />
                        </div>
                        <div class="DivTextBox">
                            <asp:ListBox ID="lsbExistingOffice" Style="float: left" runat="server" SelectionMode="Multiple"
                                Width="13em" size="8"></asp:ListBox>
                            <div class="" style="float: left; width: 48px; height: 69px; padding-left: 19px;">
                                <asp:Button ID="btnMoveOffice" runat="server" class="btnMove" Text=">>>" CausesValidation="false"
                                    Style="margin-bottom: 5px;" />
                                <asp:Button ID="btnMoveBackOffice" runat="server" class="btnMoveBack" Text="<<<"
                                    CausesValidation="false" />
                                <asp:HyperLink ID="hplInsertOffice" runat="server" CausesValidation="false" Text="Thêm"></asp:HyperLink>
                            </div>
                        </div>
                        <asp:ListBox ID="lsbOffice" runat="server" SelectionMode="Multiple" Width="13em"
                            size="8"></asp:ListBox>
                    </div>
                    <div class="DivRow">
                        <div class="DivLabel">
                            <asp:Label ID="Label1" CssClass="TextLabel" runat="server" Text="File đính kèm:" />
                        </div>
                        <div class="DivTextBox" style="padding-left: 20px">
                            <input id="file_upload" name="file_upload" type="file" /><a id="upload" href="javascript:$('#file_upload').uploadifyUpload();">Upload
                                Files</a><br />
                            <b>Hoặc:</b><br />
                            <asp:TextBox ID="FileUpload" Text="" runat="server" CssClass="TextBox" />
                        </div>
                    </div>
                    <div class="DivRow">
                        <div class="DivLabel">
                            <asp:Label ID="lblContent" CssClass="TextLabel" runat="server" Text="Nội dung:" />
                        </div>
                        <div class="DivTextBox">
                            <CE:Editor ID="txtContent" runat="server" Width="100%" Height="500" EditorWysiwygModeCss="~/example.css">
                                <FrameStyle BackColor="White" BorderColor="#DDDDDD" BorderStyle="Solid" BorderWidth="1px"
                                    CssClass="CuteEditorFrame" Height="100%" Width="100%" />
                            </CE:Editor>
                        </div>
                    </div>
                    <div class="DivRow">
                        <div class="DivLabel" style="margin-left: 40px">
                        </div>
                        <div class="DivLabel">
                        </div>
                    </div>
                    <div class="DivRow">
                        <div class="DivLabel">
                            &nbsp;&nbsp;&nbsp;</div>
                        <div class="DivTextBox">
                            <asp:Button ID="btnSave" runat="server" Text=" Lưu " CssClass="btn" />&nbsp;
                            <asp:Button ID="btnHuy" CausesValidation="false" runat="server" Text=" Hủy " CssClass="btn" />
                            <asp:Button ID="btnReloadList" CausesValidation="false" runat="server" CssClass="btn"
                                Style="visibility: hidden" />
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div style="display: none">
            <asp:HiddenField ID="hidID" Value="0" runat="server" />
            <asp:HiddenField ID="hidImagePath" Value="0" runat="server" />
            <asp:TextBox ID="txtPromulgator" CssClass="TextBox" Text="" runat="server" Style="visibility: hidden"></asp:TextBox>
            <asp:TextBox ID="txtStrPromulgator" CssClass="TextBox" Text="" runat="server" Style="visibility: hidden"></asp:TextBox>
        </div>
    </ContentTemplate>
</asp:UpdatePanel>
